package net.java.mediasystems.database.core.repository.jpa;

import java.util.List;

import net.java.mediasystems.database.core.model.MediaQuality;
import net.java.mediasystems.database.core.model.MediaType;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface MediaQualityRepository extends JpaRepository<MediaQuality, Long> {

	/**
	 * Find a MediaQuality by given MediaType (case-sensitive) and name (not case-sensitive).
	 * 
	 * @param mediaType MediaType
	 * @param name String
	 * @return MediaQuality
	 */
	MediaQuality findByMediaTypeAndNameIgnoreCase(MediaType mediaType, String name);
	
	/**
	 * Find all MediaQualities by given MediaType.
	 * 
	 * @param mediaType MediaType
	 * @return List<MediaQuality>
	 */
	List<MediaQuality> findAllByMediaType(MediaType mediaType);
}
